import request from "@/utils/request.js";

/**
 * 获取轮播图数据
 */
export function getBannerData() {
  return request({
    url: "/admin/banner/list",
    method: "GET",
  });
}

/**
 * 新增一个轮播图
 */
export function addBanner(params) {
  return request({
    url: "/admin/banner/add",
    method: "POST",
    data: params,
  });
}

/**
 * 删除轮播图
 */
 export function delBanner(bannerid) {
  return request({
    url: "/admin/banner/delete",
    method: "GET",
    params: {
      bannerid,
    },
  });
}

/**
 * 删除全部轮播图
 */
export function BannerAll(bannerids) {
  return request({
    url: "/admin/banner/removeAll",
    method: "GET",
    params: {
      bannerids,
    },
  });
}

/**
 * 获取轮播图数据2
 */
export function getBannerData2() {
  return request({
    url: "http://localhost:3000/banners",
    method: "GET",
  });
}
